import React,{Component} from 'react';
import { View, Text, Button } from 'react-native';

class DetailsScreen extends Component{

    render() {
        let houdun = this.props.navigation.state.params.name;
        console.log(this.props.navigation.state.params.name);
        const {goBack} = this.props.navigation;
        return (
            <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
               <Text style={{fontSize:30}}>Details Screen{houdun}</Text>
                <Button
                    onPress={()=>{
                        goBack();
                    }}
                    title={"点我返回！！！！"}
                />
            </View>
        )
    }
}

// const DetailsScreen = (navigation) => {
//     // console.log(navigation.navigation.state.params.name);
//     let houdun = navigation.navigation.state.params.name;
//     return (
//         <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
//             <Text style={{fontSize:30}}>Details Screen{houdun}</Text>
//         </View>
// )};

export default DetailsScreen;